package net.dgg.zz.credential.externalFunction.dao;


import net.dgg.zz.credential.externalFunction.entity.ProductReservation;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

@Component
public interface ProductReservationDao {
    int deleteByPrimaryKey(Long id);

    int insert(ProductReservation record);

    int insertSelective(ProductReservation record);

    ProductReservation selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ProductReservation record);

    int updateByPrimaryKey(ProductReservation record);

    List<Map> queryDataWithPage(Map params);


    /**
     * 根据证书code查询关联该证书的预约，按照预约时间进行排序
     *
     * @param storageCapacityCode
     * @return
     */
    List<ProductReservation> queryReservationByStorageCapacity(List<String> storageCapacityCode);


    /**
     * 根据证书code查询关联该证书的最早预约，按照预约时间进行排序
     *
     * @param storageCapacityCode
     * @return
     */
    ProductReservation queryReservationByEarliestStorageCapacity(@Param("storageCapacityCode") List<String> storageCapacityCode, @Param("status") String status);

    /**
     * 根据生产订单信息或者证书信息查询预约
     * @param params
     * @return
     */
    List<ProductReservation> queryReservationByProduct(Map params);


    /**
     * <p>@Description 通过生产订单查相关的预约</p>
     * <p>@author mqy</p>
     * <p>@Time 2018/8/28 0028 19:59 创建时间</p>
     * <p>@return</p>
     */
    List<Map> queryListByScOrderIdWithPage(Map params);


    Integer queryReservationNumberByProduct(Map params);
}